<?php
add_action('admin_menu', 'cfmb_menu_page');

function cfmb_menu_page()
{
	add_theme_page('Cfmb Theme Option', 'Theme option', 'manage_options', 'cfmb-theme-option', 'cfmb_setting_page');
}

add_action('admin_init', 'cfmb_register_setting');

function cfmb_register_setting()
{
	register_setting('cfmb-group', 'cfmb-num-slide');
	register_setting('cfmb-group', 'cfmb-num-cat');
}

function cfmb_setting_page()
{?>
	<div class='wrap'>
		<?php screen_icon(); ?>
		<h2>CFMB Page Setting</h2>
		<form id='cfmb_setting' method='post' action="options.php">
		<?php settings_fields('cfmb-group'); ?>
			<table class='cfmb_page'>
				<tr valign='top'>
					<th scope='row'>Limit slide</th>
					<td><input type='text' value='<?php echo get_option('cfmb-num-slide'); ?>' name='cfmb-num-slide' /></td>
				</tr>
				<tr valign='top'>
					<th scope='row'>Limit cat</th>
					<td><input type='text' value='<?php echo get_option('cfmb-num-cat'); ?>' name='cfmb-num-cat' /></td>
				</tr>
			</table>
			<?php submit_button(); ?>
		</form>
	</div>
<?php 
	}
?>
